
import 'package:json_annotation/json_annotation.dart';
part 'tuya_category.g.dart';

@JsonSerializable()
class TuyaACategory {
  final List<TuyaLevel1Category> level1List;

  TuyaACategory({required this.level1List});

  factory TuyaACategory.fromJson(Map<String, dynamic> json) =>
      _$TuyaACategoryFromJson(json);
}

@JsonSerializable()
class TuyaACategoryLevel2Model {
  final List<TuyaLevel2Category> level3Items;

  TuyaACategoryLevel2Model({required this.level3Items});

  factory TuyaACategoryLevel2Model.fromJson(Map<String, dynamic> json) =>
      _$TuyaACategoryLevel2ModelFromJson(json);
}

@JsonSerializable()
class TuyaLevel1Category {
  final String level1Code;
  final String type;
  final String name;

  factory TuyaLevel1Category.fromJson(Map<String, dynamic> json) =>
      _$TuyaLevel1CategoryFromJson(json);

  TuyaLevel1Category({required this.level1Code, required this.type, required this.name});
}


@JsonSerializable()
class TuyaLevel2Category {
    final String name;
    final String pid;
    final String icon;

  factory TuyaLevel2Category.fromJson(Map<String, dynamic> json) =>
      _$TuyaLevel2CategoryFromJson(json);

  TuyaLevel2Category({required this.name, required this.pid, required this.icon});
}

// 三级详细信息
@JsonSerializable()
class TuyaCategoryDetail {
  final bool nProcess;
  final bool fromFeedback;
  final int capability;
  final DisplayConfig display;
  final List<LinkMode> linkModes;
  final bool enableLead;
  final int manualType;

  TuyaCategoryDetail({
    required this.nProcess,
    required this.fromFeedback,
    required this.capability,
    required this.display,
    required this.linkModes,
    required this.enableLead,
    required this.manualType,
  });

  factory TuyaCategoryDetail.fromJson(Map<String, dynamic> json) =>
      _$TuyaCategoryDetailFromJson(json);

  Map<String, dynamic> toJson() => _$TuyaCategoryDetailToJson(this);
}

@JsonSerializable()
class DisplayConfig {
  final String guideTopTitle;
  final String apHelpUrl;
  final String guideConfirm;
  final String apTipIconUrl;
  final String apVideoUrl;
  final String apTip;
  final String guidePreStep;
  final String btTip;
  final String radioViewDetail;
  final String apStatusTitle;
  final String ezStatusTitle;
  final String wcVideoUrl;
  final String apAddBtText;
  final String zigsubVideoUrl;
  final String ezAddBtText;
  final String wifiTitle;
  final String gprsVideoUrl;
  final String ezTip;
  final String qrVideoUrl;
  final String singleStepHelpTip;
  final String wifiIconUrl;
  final String guideNextStep;
  final String nbVideoUrl;
  final String btTipIconUrl;
  final String btHelpUrl;
  final String btVideoUrl;
  final String ezHelpUrl;
  final String sub433VideoUrl;
  final String qcVideoUrl;
  final String hotspotName;
  final String ezStatusIconUrl;
  final String ezTipIconUrl;
  final String wifiContent;
  final String apStatusIconUrl;

  DisplayConfig({
    required this.guideTopTitle,
    required this.apHelpUrl,
    required this.guideConfirm,
    required this.apTipIconUrl,
    required this.apVideoUrl,
    required this.apTip,
    required this.guidePreStep,
    required this.btTip,
    required this.radioViewDetail,
    required this.apStatusTitle,
    required this.ezStatusTitle,
    required this.wcVideoUrl,
    required this.apAddBtText,
    required this.zigsubVideoUrl,
    required this.ezAddBtText,
    required this.wifiTitle,
    required this.gprsVideoUrl,
    required this.ezTip,
    required this.qrVideoUrl,
    required this.singleStepHelpTip,
    required this.wifiIconUrl,
    required this.guideNextStep,
    required this.nbVideoUrl,
    required this.btTipIconUrl,
    required this.btHelpUrl,
    required this.btVideoUrl,
    required this.ezHelpUrl,
    required this.sub433VideoUrl,
    required this.qcVideoUrl,
    required this.hotspotName,
    required this.ezStatusIconUrl,
    required this.ezTipIconUrl,
    required this.wifiContent,
    required this.apStatusIconUrl,
  });

  factory DisplayConfig.fromJson(Map<String, dynamic> json) =>
      _$DisplayConfigFromJson(json);

  Map<String, dynamic> toJson() => _$DisplayConfigToJson(this);
}

@JsonSerializable()
class LinkMode {
  final String title;
  final String desText;
  final List<dynamic> leadList;
  final bool updatedTag;
  final SingleLead singleLead;
  final int linkMode;

  LinkMode({
    required this.title,
    required this.desText,
    required this.leadList,
    required this.updatedTag,
    required this.singleLead,
    required this.linkMode,
  });

  factory LinkMode.fromJson(Map<String, dynamic> json) =>
      _$LinkModeFromJson(json);

  Map<String, dynamic> toJson() => _$LinkModeToJson(this);
}

@JsonSerializable()
class SingleLead {
  final String radioExplainTitle;
  final bool radioExplainFlag;
  final String radioExplainDesc;
  final String guideH5Url;
  final String AddBtText;
  final bool radioFlag;
  final bool guideFlag;
  final String radioExplainIconVideoUrl;
  final int guideType;
  final String radioExplainIconUrl;

  SingleLead({
    required this.radioExplainTitle,
    required this.radioExplainFlag,
    required this.radioExplainDesc,
    required this.guideH5Url,
    required this.AddBtText,
    required this.radioFlag,
    required this.guideFlag,
    required this.radioExplainIconVideoUrl,
    required this.guideType,
    required this.radioExplainIconUrl,
  });

  factory SingleLead.fromJson(Map<String, dynamic> json) =>
      _$SingleLeadFromJson(json);

  Map<String, dynamic> toJson() => _$SingleLeadToJson(this);
}